feat: Add instrumentation for tracking variables in debugging#4122
Merged
TomAFrench merged 21 commits intonoir-lang:masterfrom Feb 5, 2024
Merged
feat: Add instrumentation for tracking variables in debugging#4122TomAFrench merged 21 commits intonoir-lang:masterfrom
TomAFrench merged 21 commits intonoir-lang:masterfrom
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Problem*
Part of #3015
Summary*
This PR injects instrumentation snippets to the compiled code when running under a debugger to track the values assigned to variables in the program. It also provides the debugging context with necessary support code (in the form of foreign functions) and new functionality to inspect the tracked values.
Instrumentation occurs in two phases:
Additional Context
Besides the runtime support in the debugger, the compiler also injects a synthetic crate
__debugwhich holds the definition of the oracle functions used in the injected code for tracking the variables and their assigned values.These changes were extracted from the
dap-with-varsbranch ofmanastech/noirrepository where most of the development of this feature occurred. We will submit additional PRs for the remaining features in that branch, notably improved REPL and DAP support to make use of this instrumentation code.Documentation*
Check one:
PR Checklist*
cargo fmton default settings.